import http from '../utils/request'
const CommodityAPI = {

    /**采购记录列表 */
    commodityRecordList: (data) => {
        return http.request({
            url: '/api/restaurant/commodity/list',
            method: 'GET',
            data
        })
    },
    /**采购记录详情 */
    commodityRecordDetail: (data) => {
        return http.request({
            url: `/api/restaurant/commodity/getDetail`,
            method: 'GET',
            data
        })
    },
	/**根据ID删除采购单 */
	remove: (id) => {
	    return http.request({
	        url: `/api/restaurant/commodity/remove?ids=${id}`,
	        method: 'POST'
	    })
	},
    /**根据ID删除采购明细记录 */
    delDetailById: (id) => {
        return http.request({
            url: `/api/restaurant/commodity/delDetailById?ids=${id}`,
            method: 'POST'
        })
    },
	/**根据ID更新采购明细数量 */
	updateDetailNumberById: (id,number) => {
	    return http.request({
	        url: `/api/restaurant/commodity/updateDetailNumberById/${id}?number=${number}`,
	        method: 'POST'
	    })
	},
	/** 保存采购数据 */
	saveCommodity: (data) => {
	    return http.request({
	        url: `/api/restaurant/commodity/saveCommodity`,
	        method: 'POST',
	        data
	    })
	},
	/** 更新采购数据状态 */
	statusUpdate: (id,status) => {
	    return http.request({
	        url: `/api/restaurant/commodity/statusUpdate/${id}?status=${status}`,
	        method: 'POST'
	    })
	},

}
export default CommodityAPI